using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class boostController : soldier
{
    
    // Start is called before the first frame update
    void Start()
    {
        UdpPlatform=GameObject.Find("UdpServer");
        if(UdpPlatform.GetComponent<WebSocketDemo>().PlayerId==PlayerId)
            UdpPlatform.GetComponent<WebSocketDemo>().Speed*=1.25f;
        
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        float moveX = Input.GetAxis("Horizontal");
        float moveY = Input.GetAxis("Vertical");
        
        transform.rotation = Quaternion.Euler(0, 0, Mathf.Atan2(moveY, moveX) * Mathf.Rad2Deg-90);
        transform.localPosition=localPos;
        if(Health<=0)
        {
            if(PlayerId==UdpPlatform.GetComponent<WebSocketDemo>().PlayerId)
                Destroy(gameObject);
            else
                Health=1;
        }
    }
}
